﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.UI;

namespace V5_FrameWork.Data
{
    public class BaseLayoutHelper
    {
        /// <summary>
        /// 布局加载
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        public string Position(string name)
        {
            HttpContext hc = HttpContext.Current;
            string templatePageName = hc.Request["t"];
            //布局类型 模板名称 内容
            //
            StringBuilder sbLayout = new StringBuilder();
            sbLayout.Append("<div class=\"pagedesign-holder " + name + "\">");
            sbLayout.Append("</div>");
            string layoutString = string.Empty;
            layoutString = "<div></div>";
            return templatePageName;
        }


        public string RegisterScript(Control p)
        {
            if (HttpContext.Current.Request["action"] == "blocker")
            {
                string path = p.ResolveUrl("~/");
                StringBuilder sb = new StringBuilder();
                sb.AppendLine(string.Format(@"<link href=""{0}Scripts/jquery/jquery-ui/start/jquery-ui.css"" rel=""stylesheet"" type=""text/css"" />", path));
                sb.AppendLine(string.Format(@"<script src=""{0}Scripts/jquery.js"" type=""text/javascript""></script>", path));
                sb.AppendLine(string.Format(@"<script src=""{0}Scripts/jquery/jquery-ui/jquery-ui.js"" type=""text/javascript""></script>", path));
                sb.AppendLine(string.Format(@"<script src=""{0}Scripts/jquery/jquery-Designer/jQuery.Designer.js"" type=""text/javascript""></script>", path));
                return sb.ToString();
            }
            return "";
        }
    }
}
